import request from '@/config/axios'

export interface OrderCostVO {
  orderNumber: string
  dictOrderType: number
  customerName: string
  customerCode: string
  salesperson: string
  costChangePerson: string
  costChangeDate: Date
  remark: string
  productNumber: string
  productName: string
  productStandard: string
  creatorName: string
  principalMaterial: number
  auxiliaryMaterial: number
  outsourcing: number
  freight: number
  electric: number
  totalPrice: number
  dictCostStatus: number
  id: number
}

// 报表查询-工程部报表-工程部报表列表
export const getEngineeringPage = async (params) => {
  return await request.get({ url: `/report/engineering-word/page`, params })
}

// 报表查询-工程部报表-工程部报表列表保存与提交
export const saveOrSubmit = async (data) => {
  return await request.post({ url: `/report/engineering-word/saveOrSubmit`, data })
}

// 新增订单管理-订单报表-成本估算表(项目技术室)
export const createOrderCost = async (data: OrderCostVO) => {
  return await request.post({ url: `/report/order-cost/create`, data })
}

// 修改订单管理-订单报表-成本估算表(项目技术室)
export const updateOrderCost = async (data) => {
  return await request.put({ url: `report/order-cost/saveOrSubmit`, data })
}

// 删除工程部报表-
export const deleteOrderCost = async (id: number) => {
  return await request.delete({ url: `/report/order-cost/delete?id=` + id })
}

// 导出订单管理-订单报表-成本估算表(项目技术室) Excel
export const exportOrderCost = async (data) => {
  return await request.download({ url: `/report/order-cost/export-excel`, data })
}
